/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import javax.imageio.ImageIO;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import model.Field;
import model.Game.Difficulties;
import model.LevelInterpreter.Parts;
import model.LevelManager;
import model.LevelSpecification;
import model.LevelSpecificationBuilder;
import utilities.ImageFilter;

/**
 *
 * @author meije_000
 */
public class LevelSpecificationBuilderPaneel extends javax.swing.JPanel {

    private LevelSpecificationBuilder levelSpecificationBuilder;
            HoofdFrame hoofdframe;
    /**
     * Creates new form LevelSpecificationBuilderPanel
     */
    public LevelSpecificationBuilderPaneel(LevelSpecification levelSpecification, HoofdFrame frame) {
        initComponents();
        System.out.println("kaas2");
        hoofdframe = frame;
        
        this.levelSpecificationBuilder = new LevelSpecificationBuilder(levelSpecification);
        this.txtColumns.setText("" + levelSpecificationBuilder.getLevelSpecification().getFieldSpecification()[0].length);
        this.txtLevelName.setText(levelSpecificationBuilder.getLevelSpecification().getName());
        this.txtRows.setText("" + levelSpecificationBuilder.getLevelSpecification().getFieldSpecification().length);
        this.draw();
    }
    
    public LevelSpecificationBuilderPaneel(HoofdFrame frame) {
        hoofdframe = frame;
        initComponents();
        this.levelSpecificationBuilder = new LevelSpecificationBuilder();
    }

    private void messageDialog(ArrayList<String> messages) {
        String message = "";
        Iterator<String> it = messages.iterator();
        while (it.hasNext()) {
            message = message + it.next() + "\n";
        }
        JOptionPane.showMessageDialog(this, message);
    }

    private void messageDialog(String message) {
        JOptionPane.showMessageDialog(this, message);
    }

    private void draw() {
        ArrayList<Field> temporaryLevel = this.levelSpecificationBuilder.getLevelInterpreter().interpreterLevel(this.levelSpecificationBuilder.getLevelSpecification());
        this.pnlFields.setFields(temporaryLevel);
        this.pnlFields.repaint();
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        txtLevelName = new javax.swing.JTextField();
        txtSecondXCoordinate = new javax.swing.JTextField();
        txtSecondYCoordinate = new javax.swing.JTextField();
        lblDivider = new javax.swing.JLabel();
        btnGenerateField = new javax.swing.JButton();
        lblName = new javax.swing.JLabel();
        lblRows = new javax.swing.JLabel();
        txtFirstXCoordinate = new javax.swing.JTextField();
        lblColumns = new javax.swing.JLabel();
        txtRows = new javax.swing.JTextField();
        txtColumns = new javax.swing.JTextField();
        pnlFields = new view.FieldPanel();
        lblImageType = new javax.swing.JLabel();
        lblPartType = new javax.swing.JLabel();
        lblDivider1 = new javax.swing.JLabel();
        btnSave = new javax.swing.JButton();
        btnAddImage = new javax.swing.JButton();
        lblXCoordinate = new javax.swing.JLabel();
        lblYCoordinate = new javax.swing.JLabel();
        lblDifficulty = new javax.swing.JLabel();
        txtFirstYCoordinate = new javax.swing.JTextField();
        btnSetParts = new javax.swing.JButton();
        Back = new javax.swing.JButton();

        txtSecondXCoordinate.setText("0");

        txtSecondYCoordinate.setText("0");

        lblDivider.setText("-");

        btnGenerateField.setText("Generate");
        btnGenerateField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGenerateFieldActionPerformed(evt);
            }
        });

        lblName.setText("Name");

        lblRows.setText("Rows");

        txtFirstXCoordinate.setText("0");

        lblColumns.setText("Columns");

        cboDifficulty.setModel(new DefaultComboBoxModel<>(Difficulties.values()));

        javax.swing.GroupLayout pnlFieldsLayout = new javax.swing.GroupLayout(pnlFields);
        pnlFields.setLayout(pnlFieldsLayout);
        pnlFieldsLayout.setHorizontalGroup(
            pnlFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );
        pnlFieldsLayout.setVerticalGroup(
            pnlFieldsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 600, Short.MAX_VALUE)
        );

        lblImageType.setText("Image");

        lblPartType.setText("Part");

        lblDivider1.setText("-");

        btnSave.setText("Save");
        btnSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSaveActionPerformed(evt);
            }
        });

        cboImageType.setModel(new DefaultComboBoxModel<>(Parts.values()));

        btnAddImage.setText("Add");
        btnAddImage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddImageActionPerformed(evt);
            }
        });

        lblXCoordinate.setText("X");

        lblYCoordinate.setText("Y");

        lblDifficulty.setText("Difficulty");

        txtFirstYCoordinate.setText("0");

        btnSetParts.setText("Set");
        btnSetParts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSetPartsActionPerformed(evt);
            }
        });

        cboPartType.setModel(new DefaultComboBoxModel<>(Parts.values()));

        Back.setText("Back");
        Back.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BackActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(23, 23, 23)
                                .addComponent(lblName)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtLevelName, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(btnAddImage, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnSave, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(lblDifficulty)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(cboDifficulty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(lblColumns)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(txtColumns, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(layout.createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lblImageType)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(cboImageType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(btnSetParts)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lblPartType)
                                            .addGap(18, 18, 18)
                                            .addComponent(cboPartType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lblYCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(txtFirstYCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(2, 2, 2)
                                            .addComponent(lblDivider)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(txtSecondYCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lblXCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(txtFirstXCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(lblDivider1, javax.swing.GroupLayout.PREFERRED_SIZE, 4, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(txtSecondXCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addComponent(btnGenerateField)
                                        .addGroup(layout.createSequentialGroup()
                                            .addComponent(lblRows)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(txtRows, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(Back)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(pnlFields, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(Back)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtLevelName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblName))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtRows, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblRows))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtColumns, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblColumns))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnGenerateField, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtSecondXCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblDivider1)
                            .addComponent(txtFirstXCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblXCoordinate))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtSecondYCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtFirstYCoordinate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblDivider)
                            .addComponent(lblYCoordinate))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cboPartType, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblPartType))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnSetParts, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cboImageType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblImageType))
                        .addGap(18, 18, 18)
                        .addComponent(btnAddImage)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cboDifficulty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblDifficulty))
                        .addGap(18, 18, 18)
                        .addComponent(btnSave))
                    .addComponent(pnlFields, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnGenerateFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerateFieldActionPerformed

        if (this.levelSpecificationBuilder.getLevelSpecification().getImage(Parts.TERRAIN) == null) {
            this.messageDialog("Voeg eerst een terrain plaatje toe");
            return;
        }

        if (this.levelSpecificationBuilder.getLevelSpecification().getFieldSpecification() != null) {
            int reply = JOptionPane.showConfirmDialog(null, "Opnieuw genereren wist het speelveld", "Pas Op!",  JOptionPane.YES_NO_OPTION);
            if (reply == JOptionPane.NO_OPTION) {
                return;
            }
        }

        try {
            int rows = Integer.parseInt(txtRows.getText());
            int columns = Integer.parseInt(txtColumns.getText());

            if (!this.levelSpecificationBuilder.generateFieldSpecification(rows, columns)) {
                this.messageDialog(this.levelSpecificationBuilder.getMsg());
                this.levelSpecificationBuilder.clearMsg();
                return;
            }
        } catch (NumberFormatException e) {
            this.messageDialog("Voer alleen gehele getallen in 0 is niet toegestaan");
        }

        this.draw();
    }//GEN-LAST:event_btnGenerateFieldActionPerformed

    private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed

        if (this.txtLevelName.getText() == null) {
            this.messageDialog("Geef het level een naam");
            return;
        }

        Difficulties difficulty = (Difficulties) cboDifficulty.getModel().getSelectedItem();
        this.levelSpecificationBuilder.setLevelSpecificationDifficulty(difficulty);

        LevelManager levelManager = new LevelManager();
        if (!levelManager.save(this.txtLevelName.getText(), this.levelSpecificationBuilder.getLevelSpecification())) {
            this.messageDialog(levelManager.getMsg());
            levelManager.clearMsg();
        } else {
            /*
             * maak een nieuw LevelManagerPaneel aan, Geef de instance van het hoofdframe mee.
             * Run uit instance hoofdframe setContentPanel om het nieuwe levelmanagerpaneel in het frame te zetten
             */
            LevelManagerPaneel levelmanager = new LevelManagerPaneel(hoofdframe);
            hoofdframe.setContentPanel(levelmanager);
           
        }
    }//GEN-LAST:event_btnSaveActionPerformed

    private void btnAddImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddImageActionPerformed

        final JFileChooser fileChooser = new JFileChooser();
        fileChooser.setFileFilter(new ImageFilter());
        int returnValue = fileChooser.showOpenDialog(this);

        if (returnValue == JFileChooser.APPROVE_OPTION) {

            File file = fileChooser.getSelectedFile();

            try {
                BufferedImage image = ImageIO.read(file);
                Parts part = (Parts) cboImageType.getModel().getSelectedItem();

                if (!this.levelSpecificationBuilder.setLevelSpecificationImage(part, image)) {
                    this.messageDialog(this.levelSpecificationBuilder.getMsg());
                    this.levelSpecificationBuilder.clearMsg();
                }

            } catch (IOException ex) {
                this.messageDialog("Laat alleen .gif bestanden op");
            }

        }
        
    }//GEN-LAST:event_btnAddImageActionPerformed

    private void btnSetPartsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSetPartsActionPerformed

        if (this.levelSpecificationBuilder.getLevelSpecification().getFieldSpecification() == null) {
            this.messageDialog("Genereer eerst een speelveld");
            return;
        }

        Parts part = (Parts) cboPartType.getModel().getSelectedItem(); // werkt niet deze check
        if (!this.levelSpecificationBuilder.getLevelSpecification().imageExists(part)) {
            this.messageDialog("Voeg eerst het plaatje toe van het part");
            return;
        }

        try {
            int xFirst = Integer.parseInt(txtFirstXCoordinate.getText());
            int yFirst = Integer.parseInt(txtFirstYCoordinate.getText());
            int xSecond = Integer.parseInt(txtSecondXCoordinate.getText());
            int ySecond = Integer.parseInt(txtSecondYCoordinate.getText());

            if (!this.levelSpecificationBuilder.editFieldSpecification(xFirst, xSecond, yFirst, ySecond, part)) {
                this.messageDialog(this.levelSpecificationBuilder.getMsg());
                this.levelSpecificationBuilder.clearMsg();
                return;
            }

            this.draw();
        } catch (NumberFormatException e) {
            this.messageDialog("Voer alleen gehele getallen in 0 is toegestaan");
        }
    }//GEN-LAST:event_btnSetPartsActionPerformed

    private void BackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BackActionPerformed
            /*
             * maak een nieuw LevelManagerPaneel aan, Geef de instance van het hoofdframe mee.
             * Run uit instance hoofdframe setContentPanel om het nieuwe levelmanagerpaneel in het frame te zetten
             */
            LevelManagerPaneel levelmanager = new LevelManagerPaneel(hoofdframe);
            hoofdframe.setContentPanel(levelmanager);
  
    }//GEN-LAST:event_BackActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Back;
    private javax.swing.JButton btnAddImage;
    private javax.swing.JButton btnGenerateField;
    private javax.swing.JButton btnSave;
    private javax.swing.JButton btnSetParts;
    private final javax.swing.JComboBox cboDifficulty = new javax.swing.JComboBox<Difficulties>();
    private final javax.swing.JComboBox cboImageType = new javax.swing.JComboBox<Parts>();
    private final javax.swing.JComboBox cboPartType = new javax.swing.JComboBox<Parts>();
    private javax.swing.JLabel lblColumns;
    private javax.swing.JLabel lblDifficulty;
    private javax.swing.JLabel lblDivider;
    private javax.swing.JLabel lblDivider1;
    private javax.swing.JLabel lblImageType;
    private javax.swing.JLabel lblName;
    private javax.swing.JLabel lblPartType;
    private javax.swing.JLabel lblRows;
    private javax.swing.JLabel lblXCoordinate;
    private javax.swing.JLabel lblYCoordinate;
    private view.FieldPanel pnlFields;
    private javax.swing.JTextField txtColumns;
    private javax.swing.JTextField txtFirstXCoordinate;
    private javax.swing.JTextField txtFirstYCoordinate;
    private javax.swing.JTextField txtLevelName;
    private javax.swing.JTextField txtRows;
    private javax.swing.JTextField txtSecondXCoordinate;
    private javax.swing.JTextField txtSecondYCoordinate;
    // End of variables declaration//GEN-END:variables
}
